String.prototype.GetValue= function(para) {
var reg = new RegExp("(^|&)"+ para +"=([^&]*)(&|$)");
var r = this.substr(this.indexOf("\?")+1).match(reg);
if (r!=null) return unescape(r[2]); return null;
}
//page, view value
var str = location.href;
var page = str.GetValue("page");
var view = str.GetValue("v"); //them moi
var homepageurl = "http://move5s.blogspot.com/";
var urllength = homepageurl.length;
if (page==undefined) { page = "1"; }
if (view==undefined) { view = "full"; } //them moi
if (str.indexOf("search/label")!=-1) {
if (str.indexOf("?")!=-1){
var str1 = str.split("?")[0];
var label = str1.substring(urllength+13,str1.length);
}
else {
var label = str.substring(urllength+13,str.length);
}
var textlabel = "/-/"+label;
var textpage = "search/label/"+label;
}
else {var textlabel ="";var textpage = ""; }
// remove tags
function stripHtmlTags(s,max){
s=s.replace(/<br.*?>/ig, ' ');
return s.replace(/<.*?>/ig, '').split(/\s+/).slice(0,max-1).join(' ')
}
//get RSS FEED
function showrecentposts(json) {
img = new Array();
  document.write('<div class="block"><div class="title"><h2>Tìm kiếm với từ khoá : "<span style="color:yellow; font-weight:bold;">'+decodeURI(label)+'</span>" </h2><p class="more"><a href="#">Hướng dẫn xem phim</a></p></div><div class="content">');
for (var i = 0; i < numposts; i++) {

    //Get Entry
    var entry = json.feed.entry[i];
    var posttitle = entry.title.$t;
    var pcm ;
    var posturl;
    
    //Get Image Thumb
    if("media$thumbnail" in entry){
    var thumburl = entry.media$thumbnail.url;
    }
    else{ var thumburl = "http://lh6.googleusercontent.com/-8fE2X7kBhWs/Tf96WzivFHI/AAAAAAAAB0s/fItUKGW08gY/no-image.png"};
    
    if (i == json.feed.entry.length) break;
    
    //Get link Url
    for (var k = 0; k < entry.link.length; k++) {
        if (entry.link[k].rel == 'alternate') {
        posturl = entry.link[k].href;
            break;
        }
    }    
    
    //Get Label
    var plabel = new Array();
    var cate = entry.category;
    if(cate) {
        for (var k = 0; k < entry.category.length; k++) {
            plabel[k] = ' <a class="label-link" href="http://move5s.blogspot.com/search/label/'+entry.category[k].term+'">'+entry.category[k].term+'</a> ';
        }
    }
    else {plabel = "No label";}
    
    //Get body (Post)
    var authpost = entry.author[0].name.$t;
    var postdate = entry.published.$t;
    var month = [1,2,3,4,5,6,7,8,9,10,11,12];
    var month2 = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
    var day = postdate.split("-")[2].substring(0,2);
    var m = postdate.split("-")[1];
    var y = postdate.split("-")[0];
    postDay = day+ "/" + m + "/" + y ;
    
        //Post Content
    if ("content" in entry) {
        var postcontent = entry.content.$t;}
    else if ("summary" in entry) {
        var postcontent = entry.summary.$t;}
    else postcontent = "";
    
    s = postcontent; a = s.indexOf("<img"); b = s.indexOf("src=\"",a); c = s.indexOf("\"",b+5); d = s.substr(b+5,c-b-5);
    
        //Post Image
    if((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")) {img[i] = d;}
    else {img[i]="http://1.bp.blogspot.com/_u4gySN2ZgqE/SosvnavWq0I/AAAAAAAAArk/yL95WlyTqr0/s400/noimage.png";}

    
    //Data show for view.

    var td_list = "";
    if(i == 0){td_list = '<ul class="list_films">';}
    td_list +='<li><span class="process"><span>'+plabel[0]+'</span></span><div class="poster"><p class="img"><a href="'+posturl+'" title="'+stripHtmlTags(postcontent,73)+'" rel="'+posttitle+'"><img src="'+img[i]+'" width="120px" height="160px" /></a></p><h3 class="name"><a href="'+posturl+'">'+posttitle+'</a></h3></li>';
    if(i == 16){td_list = '</ul>';}
    if(i==3 || i==7 || i==11){td_list += '</ul><ul class="list_films">';}

        //Check view --
    document.write(td_list);
        
    } //End for
 document.write('</div><div class="clear"></div></div>');
}    //End function

// get total number of posts
function numberOfPosts(json) {
document.write('<script style=\"text/javascript\">var totalPosts= '+json.feed.openSearch$totalResults.$t+' ;<\/script>');
}
document.write('<script src=\"http://move5s.blogspot.com/feeds/posts/default'+textlabel+'?alt=json-in-script&callback=numberOfPosts\"><\/script>');